{% include "base.html" %}

{% block body %}
<h1>{{ topic.title }}</h1>
{% for entry in entry_list %}
<table border=0>
    <tr bgcolor=#ffccff>
        <td colspan=3 width=630 align=right>{{ entry.date }}</td>
    </tr>
    <tr>
        <td align=center height=30 width=100 bgcolor=#ffaaff>{{ entry.member.user.username }}</td>
        <td  colspan=2 width="600" style="vertical-align:top" >{{ entry.text }}</td>
        <td height=100 width="60" bgcolor=#ff00ff>
        {% if perms.forum.add_vote %}
         	<table>
         	<tr>
	         	<td align=center width="60">
    	     		<a href="{% url voteEntry entry.id 1 %}">Begendim</a>
        	 	</td>
         	</tr>
			<tr>
				<td align=center >
					<a href="{% url voteEntry entry.id 0 %}">Begenmedim</a>
				</td>
			</tr>
			<tr>
				<td align=center >
					<a href="{% url voteEntry entry.id 2 %}">kararsizim</a>
				</td>
			</tr>
			</table>
		{% endif%}
        </td>
    </tr>
{% if perms.forum.change_entry or perms.forum.change_entry %}
{% if perms.forum.change_entry or entry.isEdited %}
    <tr align=right height=20>
    {% if perms.forum.change_entry %}
    	<td>
    		<a href="{% url editEntry entry.id %}">edit</a>
    	</td>
    {% endif %}
    {% if perms.forum.delete_entry %}
    	<td width=60 >
    		<a href="{% url deleteEntry entry.id %}">delete</a>
    	</td>
    {% endif %}
    	<td colspan=2>
		{% if entry.isEdited %}
    		bu girdi {{ entry.editDate }} tarihinde {{ entry.editBy }} tarafindan tekrar duzenlenmistir.
    	{% endif %}
    	</td>
    </tr>
{% endif %}
{% endif %}
</table>

{% endfor %}
{% if perms.forum.add_entry %}
	<form action="{% url showTopic topic.id topic.title %}" method="post">
		{% csrf_token %}
		{% for field in form %}
			{{ field }}
		{% endfor %}
		<br />
		<input type="submit" value="Yolla" />
	</form> 
{% endif %}
{% endblock %}
